package org.cainiao.io.netty.other.schedule;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

/**
 * <br />
 * <p>
 * Author: Cai Niao(wdhlzd@163.com)<br />
 */
public class ScheduleTest {

    public static void main(String[] args) {
        ScheduledExecutorService executor = Executors.newScheduledThreadPool(10);
        ScheduledFuture<?> future = executor.schedule(
            new Runnable() {
                @Override
                public void run() {
                    System.out.println("60 seconds later");
                }
            }, 60, TimeUnit.SECONDS);
        // ...
        executor.shutdown();
    }

}
